<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/vue.js"></script>
		<script src="js/vue-router.js"></script>
	</head>
	<body>
		<div id="a">
			<router-link to="/home">第一页</router-link>
			<router-link to="/help">第二页</router-link>
			<router-view></router-view>
			<help>45</help>
			<home>4566</home>
		</div>
		
		<script>
			let home= Vue.component("home",{
				template:'<h1>我是第一页</h1>'
			})
			// let home={
			// 	template:
			// 		'<h1>我是第一页</h1>'
			// }
			let help={
				template:
					"<h1>我是第二页</h1>"
				
			}
			
			let router=new VueRouter({
				routes:[
					{path:"/home",component:home},
					{path:"/help",component:help}
				]
			})
			
			new Vue({
				el:"#a",
				router
			})
		</script>
	</body>
</html>
